Ext.define('js.ctrl.Common', {
    extend: 'Ext.app.ViewController',
    alias: 'controller.Common',
    requires: ['js.Util'],

    // 退出
    signOut: function () {
        let success = function () {
                util.get('signOut').then(success, fail);
            },
            fail = function () {
                console.log('fail');
            };
    },

    renderDepartment: function (v) {
        let str = v + 1;
        return '234';
    },
    renderDataIsNull: function (v) {
        return v || '/';
    },
    renderGroupStaffDataIsNull: function (v) {
        return v ? `<a href="#" style="text-decoration : none" >${v}</a>` : '/';
    },
    test11: function () {
        return 'test11';
    },
    ComboStoreA:function(){
        let statesA= Ext.create('Ext.data.Store', {
            fields: ['value', 'dataType'],
            data : [
                {"value":"AL", "dataType":"Alabama"},
                {"value":"AK", "dataType":"Alaska"},
                {"value":"AZ", "dataType":"Arizona"}
            ]
        });
        return statesA;

    },

    // 转大写
    toUpperCase: function (v) {
        return v.toString().toUpperCase();
    }
});